<?php

namespace App\Service\Auth;

use App\Model\User;

/**
 * 手机号检测
 */
class PhoneCheckService extends AuthBaseService
{
    protected function RoVerifyList()
    {
        return [
            'phone' => "required|string",
        ];
    }

    public function handle()
    {
        $phone = $this->request->input('phone', '');

        //检测手机号
        $check = User::checkPhone($phone);
        return [
            'is_register' => $check ? 1 : 0
        ];
    }
}
